<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
  <style>
    @keyframes shake {
      0% {
        transform: translateX(0);
      }
      50% {
        transform: translateX(50px);
      }
      100% {
        transform: translateX(0);
      }
    }

    .box {
      width: 100px;
      height: 100px;
      background-color: red;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .animate{
      animation: shake 2s infinite alternate;
    }
  </style>
</head>
<body>
  <div id="app"></div>
  <script src="js/vue.js"></script>
  <script>
    const app = Vue.createApp({
      data() {
        return {
          isAnimate: false
        }
      },
      methods:{
        deal(){
          this.isAnimate = !this.isAnimate;
        }
      },
      template: `
         <div>
            <div class="box" :class="{animate: isAnimate}">撩课学院</div>
            <button @click="deal">开始/结束</button>
         </div>
      `
    }).mount('#app');
  </script>
</body>
</html>
